Skip to content

fix Unicode manipulation#18

Open
Andriamanitra wants to merge 1 commit intoNicolaiSoeborg:masterfrom
Andriamanitra:master
Open

fix Unicode manipulation#18
Andriamanitra wants to merge 1 commit intoNicolaiSoeborg:masterfrom
Andriamanitra:master

Conversation

@Andriamanitra
Copy link

@Andriamanitra Andriamanitra commented Jan 28, 2026

The old getText method didn't handle multi-byte characters properly which would cause some bytes to get left behind. The lua string.match group %a also only matches ASCII letters so letters like 'ä' or 'µ' would not get matched.

Let's say you used the upper command on the string "hëllö". You would get:

  • Before this PR: HëLL
  • Now: HËLLÖ

I did not bother fixing the other more complicated methods (title, pascal, etc.) because I don't think they're often used and it would be rather complicated as Lua doesn't have great tools for handling Unicode characters. Micro exposes the strings package from Go, but you'd need to rewrite the whole thing to use it.

closes #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect case change in non-English Unicode texts

1 participant